/**
 *
 */
package org.cloud.im.core.protocol;

import org.cloud.im.core.ImChannelContext;
import org.cloud.im.core.ImPacket;
import org.cloud.im.core.packets.Command;

/**
 * @Author: w.weidong.lin@abite.com
 * @Description: 转换不同协议消息包
 * @Date: create in 2021/10/19 14:14
 */
public interface IProtocolConverter {
    /**
     * 转化请求包
     * @param body
     * @param command
     * @param imChannelContext
     * @return
     */
    ImPacket ReqPacket(byte[] body, Command command, ImChannelContext imChannelContext);

    /**
     * 转化响应包
     * @param body
     * @param command
     * @param imChannelContext
     * @return
     */
    ImPacket RespPacket(byte[] body, Command command, ImChannelContext imChannelContext);

    /**
     * 转化响应包
     * @param imPacket
     * @param command
     * @param imChannelContext
     * @return
     */
    ImPacket RespPacket(ImPacket imPacket, Command command, ImChannelContext imChannelContext);
}
